home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / pangomm-1.4 / pangomm / language.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-04-20  |  6.1 KB  |  246 lines

  1. // -*- c++ -*-
  2. // Generated by gtkmmproc -- DO NOT MODIFY!
  3. #ifndef _PANGOMM_LANGUAGE_H
  4. #define _PANGOMM_LANGUAGE_H
  5.  
  6. #include <glibmm.h>
  7.  
  8. /* Copyright (C) 2002 The gtkmm Development Team
  9.  *
  10.  * This library is free software; you can redistribute it and/or
  11.  * modify it under the terms of the GNU Library General Public
  12.  * License as published by the Free Software Foundation; either
  13.  * version 2 of the License, or (at your option) any later version.
  14.  *
  15.  * This library is distributed in the hope that it will be useful,
  16.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  18.  * Library General Public License for more details.
  19.  *
  20.  * You should have received a copy of the GNU Library General Public
  21.  * License along with this library; if not, write to the Free
  22.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  23.  */
  24.  
  25. #include <pango/pango-attributes.h>
  26.  
  27.  
  28. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  29. extern "C" { typedef struct _PangoLanguage PangoLanguage; }
  30. #endif
  31.  
  32. namespace Pango
  33. {
  34.  
  35. /** @addtogroup pangommEnums Enums and Flags */
  36.  
  37. /**
  38.  * @ingroup pangommEnums
  39.  */
  40. enum Script
  41. {
  42.   SCRIPT_INVALID_CODE = -1,
  43.   SCRIPT_COMMON,
  44.   SCRIPT_INHERITED,
  45.   SCRIPT_ARABIC,
  46.   SCRIPT_ARMENIAN,
  47.   SCRIPT_BENGALI,
  48.   SCRIPT_BOPOMOFO,
  49.   SCRIPT_CHEROKEE,
  50.   SCRIPT_COPTIC,
  51.   SCRIPT_CYRILLIC,
  52.   SCRIPT_DESERET,
  53.   SCRIPT_DEVANAGARI,
  54.   SCRIPT_ETHIOPIC,
  55.   SCRIPT_GEORGIAN,
  56.   SCRIPT_GOTHIC,
  57.   SCRIPT_GREEK,
  58.   SCRIPT_GUJARATI,
  59.   SCRIPT_GURMUKHI,
  60.   SCRIPT_HAN,
  61.   SCRIPT_HANGUL,
  62.   SCRIPT_HEBREW,
  63.   SCRIPT_HIRAGANA,
  64.   SCRIPT_KANNADA,
  65.   SCRIPT_KATAKANA,
  66.   SCRIPT_KHMER,
  67.   SCRIPT_LAO,
  68.   SCRIPT_LATIN,
  69.   SCRIPT_MALAYALAM,
  70.   SCRIPT_MONGOLIAN,
  71.   SCRIPT_MYANMAR,
  72.   SCRIPT_OGHAM,
  73.   SCRIPT_OLD_ITALIC,
  74.   SCRIPT_ORIYA,
  75.   SCRIPT_RUNIC,
  76.   SCRIPT_SINHALA,
  77.   SCRIPT_SYRIAC,
  78.   SCRIPT_TAMIL,
  79.   SCRIPT_TELUGU,
  80.   SCRIPT_THAANA,
  81.   SCRIPT_THAI,
  82.   SCRIPT_TIBETAN,
  83.   SCRIPT_CANADIAN_ABORIGINAL,
  84.   SCRIPT_YI,
  85.   SCRIPT_TAGALOG,
  86.   SCRIPT_HANUNOO,
  87.   SCRIPT_BUHID,
  88.   SCRIPT_TAGBANWA,
  89.   SCRIPT_BRAILLE,
  90.   SCRIPT_CYPRIOT,
  91.   SCRIPT_LIMBU,
  92.   SCRIPT_OSMANYA,
  93.   SCRIPT_SHAVIAN,
  94.   SCRIPT_LINEAR_B,
  95.   SCRIPT_TAI_LE,
  96.   SCRIPT_UGARITIC
  97. };
  98.  
  99. } // namespace Pango
  100.  
  101.  
  102. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  103. namespace Glib
  104. {
  105.  
  106. template <>
  107. class Value<Pango::Script> : public Glib::Value_Enum<Pango::Script>
  108. {
  109. public:
  110.   static GType value_type() G_GNUC_CONST;
  111. };
  112.  
  113. } // namespace Glib
  114. #endif /* DOXYGEN_SHOULD_SKIP_THIS */
  115.  
  116.  
  117. namespace Pango
  118. {
  119.  
  120.  
  121. /** A Pango::Language is used to represent a language.
  122.  */
  123. class Language
  124. {
  125.   public:
  126. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  127.   typedef Language CppObjectType;
  128.   typedef PangoLanguage BaseObjectType;
  129.  
  130.   static GType get_type() G_GNUC_CONST;
  131. #endif /* DOXYGEN_SHOULD_SKIP_THIS */
  132.  
  133.  
  134.   explicit Language(PangoLanguage* gobject, bool make_a_copy = true);
  135.  
  136.   Language(const Language& other);
  137.   Language& operator=(const Language& other);
  138.  
  139.   ~Language();
  140.  
  141.   void swap(Language& other);
  142.  
  143.   ///Provides access to the underlying C instance.
  144.   PangoLanguage*       gobj()       { return gobject_; }
  145.  
  146.   ///Provides access to the underlying C instance.
  147.   const PangoLanguage* gobj() const { return gobject_; }
  148.  
  149.   ///Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
  150.   PangoLanguage* gobj_copy() const;
  151.  
  152. protected:
  153.   PangoLanguage* gobject_;
  154.  
  155. private:
  156.  
  157.    //This function is a bad hack for internal use by renderers and Pango (from pango/pango-utils.c)
  158.    //This is defined as a macro
  159.   
  160.  
  161. public:
  162.   /** Constructs an empty language tag.
  163.    */
  164.   Language();
  165.  
  166.   /** Constructs a Pango::Language object from a RFC-3066 format language tag.
  167.    * This function first canonicalizes the string by converting it to lowercase,
  168.    * mapping '_' to '-', and stripping all characters other than letters and '-'.
  169.    */
  170.   Language(const Glib::ustring& language);
  171.  
  172.   /** Gets a RFC-3066 format string representing the given language tag.
  173.    * @return A string representing the language tag. An empty string is returned if the language tag is empty.
  174.    */
  175.   Glib::ustring get_string() const;
  176.  
  177.   
  178.   /** Checks if a language tag matches one of the elements in a list of
  179.    * language ranges. A language tag is considered to match a range
  180.    * in the list if the range is '*', the range is exactly the tag,
  181.    * or the range is a prefix of the tag, and the character after the
  182.    * tag is '-'.
  183.    * @param range_list A list of language ranges, separated by ';' characters.
  184.    * each element must either be '*', or a RFC 3066 language range
  185.    * canonicalized as by pango_language_from_string().
  186.    * @return <tt>true</tt> if a match was found.
  187.    */
  188.   bool matches(const Glib::ustring & range_list) const;
  189.   
  190.   /** Determines if @a script  is one of the scripts used to
  191.    * write @a language . The returned value is conservative;
  192.    * if nothing is known about the language tag @a language ,
  193.    * <tt>true</tt> will be returned, since, as far as Pango knows,
  194.    *  @a script  might be used to write @a language .
  195.    * 
  196.    * This routine is used in Pango's itemization process when
  197.    * determining if a supplied language tag is relevant to
  198.    * a particular section of text. It probably is not useful for
  199.    * applications in most circumstances.
  200.    * @param script A Pango::Script.
  201.    * @return <tt>true</tt> if @a script  is one of the scripts used
  202.    * to write @a language , or if nothing is known about @a language .
  203.    * 
  204.    * Since: 1.4.
  205.    */
  206.   bool includes_script(Script script) const;
  207.  
  208.  
  209. };
  210.  
  211. } /* namespace Pango */
  212.  
  213.  
  214. namespace Pango
  215. {
  216.  
  217. /** @relates Pango::Language
  218.  * @param lhs The left-hand side
  219.  * @param rhs The right-hand side
  220.  */
  221. inline void swap(Language& lhs, Language& rhs)
  222.   { lhs.swap(rhs); }
  223.  
  224. } // namespace Pango
  225.  
  226. namespace Glib
  227. {
  228.  
  229. /** @relates Pango::Language
  230.  * @param object The C instance
  231.  * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
  232.  * @result A C++ instance that wraps this C instance.
  233.  */
  234. Pango::Language wrap(PangoLanguage* object, bool take_copy = false);
  235.  
  236. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  237. template <>
  238. class Value<Pango::Language> : public Glib::Value_Boxed<Pango::Language>
  239. {};
  240. #endif /* DOXYGEN_SHOULD_SKIP_THIS */
  241.  
  242. } // namespace Glib
  243.  
  244. #endif /* _PANGOMM_LANGUAGE_H */
  245.  
  246.